// JavaScript Document
$(document).ready(function(){
  if ($('#zSlider').length) {
    zSlider();
  }
  function zSlider(ID, delay){
    var ID=ID?ID:'#zSlider';
    var delay=delay?delay:5000;
    var currentEQ=0, picnum=$('#picshow_img li').size(), autoScrollFUN;
    $('#select_btn li').eq(currentEQ).addClass('current');
    $('#picshow_img li').eq(currentEQ).show();
    autoScrollFUN=setTimeout(autoScroll, delay);
    function autoScroll(){
      clearTimeout(autoScrollFUN);
      currentEQ++;
      if (currentEQ>picnum-1) currentEQ=0;
      $('#select_btn li').removeClass('current');
      $('#picshow_img li').hide();
      $('#select_btn li').eq(currentEQ).addClass('current');
      $('#picshow_img li').eq(currentEQ).show();
      autoScrollFUN = setTimeout(autoScroll, delay);
    }
    $('#picshow').hover(function(){
      clearTimeout(autoScrollFUN);
    }, function(){
      autoScrollFUN = setTimeout(autoScroll, delay);
    });
    $('#select_btn li').hover(function(){
      var picEQ=$('#select_btn li').index($(this));
      if (picEQ==currentEQ) return false;
      currentEQ = picEQ;
      $('#select_btn li').removeClass('current');
      $('#picshow_img li').hide();
      $('#select_btn li').eq(currentEQ).addClass('current');
      $('#picshow_img li').eq(currentEQ).show();
      return false;
    });
  };

  $("#tabs li").bind("click", function () {
    var index = $(this).index();
    var divs = $("#tabs-body > div");
    $(this).parent().children("li").attr("class", "tab-nav");//将所有选项置为未选中
    $(this).attr("class", "tab-nav-action"); //设置当前选中项为选中样式
    divs.hide();//隐藏所有选中项内容
    divs.eq(index).show(); //显示选中项对应内容
  });


});


$(function(){
  $(".bg_gaozhong").hover(function(){
    $(this).addClass("bg_gaozhong_active");
    $(this).removeClass("bg_gaozhong");
  },function(){
    $(this).removeClass("bg_gaozhong_active");
    $(this).addClass("bg_gaozhong");
  });

  $(".bg_chuzhong").hover(function(){
    $(this).addClass("bg_chuzhong_active");
    $(this).removeClass("bg_chuzhong");
  },function(){
    $(this).removeClass("bg_chuzhong_active");
    $(this).addClass("bg_chuzhong");
  });

  $(".bg_xiaoxue").hover(function(){
    $(this).addClass("bg_xiaoxue_avtive");
    $(this).removeClass("bg_xiaoxue");
  },function(){
    $(this).removeClass("bg_xiaoxue_avtive");
    $(this).addClass("bg_xiaoxue");
  });

})
